import request from '../utils/Request';
export async function getQuestionList(data) {
  return request(`qm/question/list?epType=${data.epType}`);
}

export async function getTreelist(data) {
  return request(`system/tree/list?treeType=${data.type}`);
}

// 根据主键获取试题详细信息

export async function getQuestionDetail(data) {
  return request(`qm/question/${data.eqId}`);
}

// 查询试卷列表
export async function getPaperlist(data) {
  return request(
    `qm/paper/list?epClazz=${data.epClazz}&epScene=${data.epScene}&epType=${data.epType}`,
  );
}

// 根据主键获取标注试题详细信息
export async function getPaperDetail(data) {
  return request(`qm/paper/${data.epId}`);
}

// 标注训练开始答题
export async function beginAswPaper(data) {
  return request(`qm/aswPaper/begin/${data.epId}`);
}

// 查询答题列表
export async function aswQuestionList(data) {
  return request(
    `qm/aswQuestion/list/?apId=${data.apId}&pn=${data.pn}&ps=${data.ps}`,
  );
}

// 提交一道标注作业
export async function aswQuestion(data) {
  return request('qm/aswQuestion/submit', {
    body: data,
    method: 'POST',
    loading: true,
  });
}

// 答题提交答案
export async function submitPaper(data) {
  return request(`qm/aswPaper/submit`, {
    body: data,
    method: 'POST',
    loading: true,
  });
}

// 题库管理
export async function webexamList(data) {
  return request(`exam/webexam/list?qustBankType=${data.qustBankType}`);
}

// 知识库
export async function knowledgeList(data) {
  if(data.artTitle){
    return request(`content/knowledge/list?artTitle=${data.artTitle}`);
  }else{
    return request(`content/knowledge/list?artType=${data.artType}`);
  }
}

// 知识库详情
export async function knowledgeDetail(artId) {
  return request(`content/knowledge/study/${artId}`);
}

// 话题详情

export async function topicDetail(data) {
  return request(`cm/inquiry/${data.id}`);
}

// 老师列表

export async function getTeacher() {
  return request('content/review/type/T');
}

// 发表
export async function sendInquiry(data) {
  return request('cm/inquiry', {
    body: data,
    method: 'POST',
    loading: true,
  });
}

// 图片上传
export async function upload(data) {
  return request('system/user/profile/avatar', {
    body: data,
    method: 'POST',
    loading: true,
  });
}

// 阅片上传
export async function reviewUpload(data) {
  return request('content/review/upload', {
    body: data,
    method: 'POST',
    loading: true,
  });
}


// 售后服务

export async function aftermarket(data) {
  return request('sm/aftermarket', {
    body: data,
    method: 'POST',
    loading: true,
  });
}

// 查询课程是否存在
export async function orderSelect(cmCourseId) {
  return request(`sm/order/select/${cmCourseId}`, {
    method: 'POST',
    loading: true,
  });
}

export async function contentReview(data) {
  return request('content/review', {
    body: data,
    method: 'POST',
    loading: true,
  });
}

